package cn.tedu.oop;



/**用于OOP巩固练习*/
public class TestCar {
    public static void main(String[] args) {
        car c=new car();
/*        c.color="暗夜紫";
        c.brand="BMW";
        c.price=200;
        c.length=0.2;
        System.out.println(c.color);
        System.out.println(c.brand);
        System.out.println(c.price);
        System.out.println(c.length);*/
        c.setBrand("特斯拉");
        c.setColor("black");
        c.setPrice(200.02);
        c.setLength(3);
        System.out.println(c.getBrand());
        System.out.println(c.getColor());
        System.out.println(c.getPrice());
        System.out.println(c.getLength());
        car.star();
    }

}
class car{
    private String color;
    private String brand;
    private double price;
    private double length;

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public static void star(){
        System.out.println("汽车启动了");
        stop();
    }
    private static void stop(){
        System.out.println("汽车停下了");

    }

}